package com.tianzmp.ttq.admin.controller;

import com.tianzmp.ttq.admin.common.BaseResult;
import com.tianzmp.ttq.admin.common.Result;
import com.tianzmp.ttq.admin.controller.resDto.FileAddResponse;
import com.tianzmp.ttq.admin.controller.resDto.ResponseUserListDto;
import com.tianzmp.ttq.admin.entity.UserInfo;
import com.tianzmp.ttq.admin.service.IUpsFileService;
import com.tianzmp.ttq.admin.util.MapperUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 文件 前端控制器
 * </p>
 *
 * @author ttq
 * @since 2022-07-30
 */
@RestController
@RequestMapping("/admin/upsFile")
public class UpsFileController {

    @Autowired
    private IUpsFileService fileService;

    @ApiOperation(value = "file upload")
    @RequestMapping(value = "/upload",method = RequestMethod.POST)
    public BaseResult<FileAddResponse> list(@RequestParam(value = "file") MultipartFile file){
        return Result.ok(fileService.upload(file));
    }

}
